extends PlayerStatusBase
var still_time :float = 0
func start() ->void:
	actor.play_animation("sliding_loop")
	still_time = 0

# Called when the node enters the scene tree for the first time.
func run_physics_process(delta:float) -> void:
	still_time += delta
	
	var collision_info = actor.move_and_collision_info()
	if collision_info.get("is_on_wall"):
		return change_status("SlidingEnd")
	if not collision_info.get("is_on_floor"):
		return  change_status("Fall")
	if still_time > 0.5:
		change_status("SlidingEnd")
 
# Called every frame. 'delta' is the elapsed time since the previous frame.
func run_process(delta: float) -> void:
	sliding_velocity(delta)
	
func sliding_velocity(delta:float)->void:
	if not actor.is_on_floor():
		move_y(delta)
		return 
	move_toward_x(5*delta, 1.5, actor.get_face_direction())
